package com.mew.game.core.common.messge.request;

import com.zebra.common.ZebraBaseMessage;
import io.netty.buffer.ByteBuf;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

/**
 * @Author King.Song
 * @Date 2020/11/9 0009
 **/
@Data
@ToString
@NoArgsConstructor
public class PlayRequestMessage extends ZebraBaseMessage<PlayRequestMessage> {
    private long betNumber;
    private int[] otherMsg;

    @Override
    public void write(ByteBuf byteBuf) {
    }

    @Override
    public PlayRequestMessage read(ByteBuf b) {
        PlayRequestMessage message = new PlayRequestMessage();
        message.setBetNumber(readLong(b));
        int length = readInt(b);
        if (length > 0){
            int[] tempArray = new int[length];
            for (int i=0; i<length; i++){
                tempArray[i] = readInt(b);
            }
            message.setOtherMsg(tempArray);
        }
        return message;
    }
}
